using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace MySHQ.DAL
{
    public class MemberManager
    {
        private NHibernate.ISession _session;
        protected NHibernate.ISession Session { get { return _session; } set { _session = value; } }

        public MemberManager() { this.Session = SessionManager.GetCurrentSession(); }

        public int Add(MySHQ.Model.Entities.TabMember member)
        {
            int newId = (int)_session.Save(member);
            _session.Flush();
            return newId;
        }

        public MySHQ.Model.Entities.TabMember GetById(int memberId)
        {
            return _session.Get<MySHQ.Model.Entities.TabMember>(memberId);
        }
    }
}
